<template>
  <div class="good-bar use-hover">
    <img class="thumb" :src="thumb" />
    <div class="info">
      <div class="title">
        啊啊啊啊啊啊啊啊啊啊aaaaaaaaaaaaaaaaaaaaaaaaa啊啊啊啊啊啊啊啊啊
      </div>
      <div class="price" :style="{ color: priceColor }">
        <div class="uinit">￥</div>
        <div class="number">7.99</div>
        <div class="del">
          <div class="unit">￥</div>
          <div class="number">18.99</div>
          <div class="line"></div>
        </div>
      </div>
      <AfastButton
        class="add-cart"
        type="primary"
        round
        icon="increase"
      ></AfastButton>
    </div>
  </div>
</template>
<script setup lang="ts">
import AfastButton from "./AfastButton.vue";

const props = defineProps({
  thumb: {
    type: String,
  },
  priceColor: {
    type: String,
    default: "red",
  },
});
</script>
<style lang="scss">
.good-bar {
  overflow: hidden;
  width: 200px;
  cursor: pointer;
  background: var(--default-color);

  .thumb {
    width: 100%;
    height: 100px;
    padding: 10px;
    background: gray;
  }

  .info {
    width: 100%;
    margin-top: 10px;
    box-sizing: border-box;
    position: relative;
    margin-bottom: 10px;

    .title {
      margin-left: 10px;
      overflow: hidden;
      max-lines: 3;
      word-wrap: break-word;
      font-size: 15px;
    }

    .add-cart {
      position: absolute;
      right: 10px;
      bottom: 0;
      width: 25px;
      height: 25px;
    }

    .price {
      margin-left: 5px;
      align-items: end;
      margin-top: 10px;
      display: flex;

      .unit {
        line-height: 11px;
        font-size: 11px;
      }

      .number {
        line-height: 25px;
        font-size: 25px;
      }

      .del {
        color: gray;
        display: flex;
        align-items: end;
        margin-left: 5px;
        position: relative;

        .unit {
          line-height: 10px;
          font-size: 10px;
        }

        .number {
          line-height: 14px;
          font-size: 14px;
        }

        .line {
          width: 110%;
          height: 1px;
          background: gray;
          position: absolute;
          margin: auto;
          top: 3px;
          bottom: 0;
        }
      }
    }
  }
}
</style>
